// 2013-9-12上午02:22:11  net.betou.trade.main.dao.agency.impl.ProxyDaoImpl.java

package net.betou.trade.main.dao.agencyorproxy.impl;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.main.dao.agencyorproxy.ProxyDao;

import org.springframework.stereotype.Repository;

/**
 * 
 * @author 叶装装
 */
@Repository
public class ProxyDaoImpl extends DaoImpl implements ProxyDao{

	public AgentAndAdmins findProxy( Integer id ) {
		String hql = "from AgentAndAdmins bean where bean.id=? and bean.system=? and bean.justAdmin=? and bean.agencyOrProxy=?";
		return ( AgentAndAdmins ) findUnique( hql, id, false, false, false );
	}

	public AgentAndAdmins findBySelf( Integer selfId, Integer id ) {
		String hql = "from AgentAndAdmins bean where bean.id=? and bean.parent.id=? and bean.system=? and bean.justAdmin=? and bean.agencyOrProxy=?";
		return ( AgentAndAdmins ) findUnique( hql, id, selfId, false, false, false );
	}
}
